//
//  OptionValueManager.m
//  Putt
//
//  Created by BEA DONG HWAN on 10. 12. 8..
//  Copyright 2010 Ajou University. All rights reserved.
//

#import "OptionValueManager.h"


@implementation OptionValueManager


+(void)setIsTest:(BOOL)value
{
	NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
	[defaults setBool:value forKey:@"setIsTest"];
	[defaults synchronize];	
}

+(void)setClub:(int)value
{
	NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
	[defaults setInteger:value forKey:@"setClub"];
	[defaults synchronize];
}
+(void)setSwingType:(int)value
{
	NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
	[defaults setInteger:value forKey:@"setSwingType"];
	[defaults synchronize];
	
}
+(void)setBallImpact:(BOOL)value
{
	NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
	[defaults setBool:value forKey:@"setBallImpact"];
	[defaults synchronize];
	
}
+(void)setDistance:(int)value
{
	NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
	[defaults setInteger:value forKey:@"setDistance"];
	[defaults synchronize];
	
}
+(void)setTestNumber:(int)value
{
	NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
	[defaults setInteger:value forKey:@"setTestNumber"];
	[defaults synchronize];
	
}
+(void)setInterval:(int)value
{
	NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
	[defaults setInteger:value forKey:@"setInterval"];
	[defaults synchronize];
	
}
+(void)setSound:(BOOL)value
{
	NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
	[defaults setBool:value forKey:@"setSound"];
	[defaults synchronize];
}


+(void)setAutoStart:(BOOL)value
{
	NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
	[defaults setBool:value forKey:@"setAutoStart"];
	[defaults synchronize];
}



+(BOOL)autoStart
{
	return [[NSUserDefaults standardUserDefaults] boolForKey:@"setAutoStart"];
}




+(BOOL)isTest
{
	return [[NSUserDefaults standardUserDefaults] boolForKey:@"setIsTest"];
}

+(int)club
{
	return [[NSUserDefaults standardUserDefaults] integerForKey:@"setClub"];
}
+(int)swingType
{
	return [[NSUserDefaults standardUserDefaults] integerForKey:@"setSwingType"];
}
+(BOOL)ballImpact
{
	return [[NSUserDefaults standardUserDefaults] boolForKey:@"setBallImpact"];
}

+(int)distance
{
	return [[NSUserDefaults standardUserDefaults] integerForKey:@"setDistance"];
}
+(int)testNumber
{
	return [[NSUserDefaults standardUserDefaults] integerForKey:@"setTestNumber"];
	
}
+(int)interval
{
	return [[NSUserDefaults standardUserDefaults] integerForKey:@"setInterval"];
	
}
+(BOOL)sound
{
	return [[NSUserDefaults standardUserDefaults] boolForKey:@"setSound"];
	
}


+(int)getLessonTempo
{
	return [[NSUserDefaults standardUserDefaults] integerForKey:@"getLessonTempo"];
	
}
+(int)getLessonTarget
{
	return [[NSUserDefaults standardUserDefaults] integerForKey:@"getLessonTarget"];
	
}

+(void)setLessonTempo:(int)value
{
	NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
	[defaults setInteger:value forKey:@"getLessonTempo"];
	[defaults synchronize];
	
}
+(void)setLessonTarget:(int)value
{
	NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
	[defaults setInteger:value forKey:@"getLessonTarget"];
	[defaults synchronize];
}

+(int)getIndexNumber
{
	return [[NSUserDefaults standardUserDefaults] integerForKey:@"getIndexNumber"];
	
}

+(void)setIndexNumber:(int)value
{
	NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
	[defaults setInteger:value forKey:@"getIndexNumber"];
	[defaults synchronize];	
}

+(float)getBestRecord
{
	return [[NSUserDefaults standardUserDefaults] floatForKey:@"getBestRecord"];
	
}

+(void)setBestRecord:(float)value
{
	NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
	[defaults setFloat:value forKey:@"getBestRecord"];
	[defaults synchronize];	
}




+(void)setTestMode:(int)value
{
	NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
	[defaults setInteger:value forKey:@"setTestMode"];
	[defaults synchronize];	
}


+(int)getTestMode
{
	return [[NSUserDefaults standardUserDefaults] integerForKey:@"setTestMode"];
}



+(void)setLastTestDay:(NSString*)value
{
	NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
	[defaults setObject:value forKey:@"setLastTestDay"];
	[defaults synchronize];
}


+(NSString*)getLastTestDay
{
	return [[NSUserDefaults standardUserDefaults] objectForKey:@"setLastTestDay"];
}


+(void)setDefaultOptionValue
{
	[OptionValueManager setClub:0];
	[OptionValueManager setSwingType:0];
	[OptionValueManager setBallImpact:NO];
	[OptionValueManager setDistance:3];
	[OptionValueManager setTestNumber:3];
	[OptionValueManager setInterval:3];
	[OptionValueManager setSound:YES];
	[OptionValueManager setTestMode:0];
	[OptionValueManager setBestRecord:0.0f];
}
	 
+(NSString*)getIsFirstLoad
{
	return [[NSUserDefaults standardUserDefaults] objectForKey:@"getIsFirstLoad"];
}
+(void)setIsFirstLoad:(NSString*)value
{
	NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
	[defaults setObject:value forKey:@"getIsFirstLoad"];
	[defaults synchronize];
}



+(void)setCurrentSelectedResultType:(int)value
{
	NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
	[defaults setInteger:value forKey:@"setCurrentSelectedResultType"];
	[defaults synchronize];	
}
+(int)getCurrentSelectedResultType
{
	return [[NSUserDefaults standardUserDefaults] integerForKey:@"setCurrentSelectedResultType"];
	
}


@end
